]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
background: Use Garbage Collector to dispose background
authorMarco Trevisan (Treviño) <mail@3v1n0.net>
Tue, 28 May 2019 04:03:17 +0000 (23:03 -0500)
committerMarco Trevisan <mail@3v1n0.net>
Fri, 14 Jun 2019 12:24:20 +0000 (12:24 +0000)
The same Meta.Background could be used by multiple instances of background
actors, and so should not be disposed when the actor using it is destroyed.

Instead of calling `run_dispose` directly on it, just nullify the reference
on destroy method, leaving the job of doing the proper disposition to the
gabage collector that keeps the proper reference count on the Meta.Background.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/issues/501

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/558

js/ui/background.js

index 06e0388167ad02a75e5e40d02c559221248a37d6..d107fee1b88d9aaa4c59baf5c4d295685fbad1f1 100644 (file)
@@ -265,6 +265,8 @@ var Background = class Background {
     }
 
     destroy() {
+        this.background = null;
+
         this._cancellable.cancel();
         this._removeAnimationTimeout();
 
@@ -699,7 +701,6 @@ var BackgroundManager = class BackgroundManager {
                            time: FADE_ANIMATION_TIME,
                            transition: 'easeOutQuad',
                            onComplete() {
-                               oldBackgroundActor.background.run_dispose();
                                oldBackgroundActor.destroy();
                            }
                          });